﻿using System.Web.Mvc;

namespace EssenceFeed.Core.Helpers
{
    /// <summary>
    /// Image
    /// </summary>
    public static class ImageExtensions
    {
        /// <summary>
        /// A simple Image
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="imgUrl">url of the Image</param>
        /// <param name="alt">alt of the Image for SEO purposes</param>
        /// <returns></returns>
        public static string Image(this HtmlHelper helper, string imgUrl, string alt)
        {
            return Image(helper, imgUrl, null, alt);
        }

        /// <summary>
        /// A Simple Image
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="imgUrl">the url of the image</param>
        /// <param name="htmlName">ID of the Image (use for javascript)</param>
        /// <param name="alt">alt of the Image for SEO purposes</param>
        /// <returns></returns>
        public static string Image(this HtmlHelper helper, string imgUrl, string htmlName, string alt)
        {
            return Image(helper, imgUrl, htmlName, alt, null);
        }

        /// <summary>
        /// A Simple Image
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="imgUrl">The url of the image</param>
        /// <param name="htmlName">
        /// 	ID of the Image (use for javascript)
        /// 	alt of the Image for SEO purposes
        /// </param>
        /// <param name="alt">css Class for given Image</param>
        /// <param name="cssClass">css Class for the given Image</param>
        /// <returns></returns>
        public static string Image(this HtmlHelper helper, string imgUrl, string htmlName, string alt, string cssClass)
        {
            return "<img src='{0}', id='{1}', alt='{2}', class='{3}' />";
        }
    }
}